package com.example.dotavideo.base;

import com.nostra13.universalimageloader.core.DisplayImageOptions;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.ImageLoaderConfiguration;

import android.app.Application;
import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;


public class DotaVideoApplication extends Application{
	
	private static DotaVideoApplication instance;
	public static SharedPreferences sp;
	public static Context context;
	
	
	public final static String URL_TYPE_DOTA1 = "http://42.96.151.160/dota/androidfront/listVideoModule.action";
	public final static String URL_TYPE_DOTA2 = "http://42.96.151.160/dota/androidfront/listVideoModule2.action";
	//public final static String URL_LIST_FROM_TYPE = "http://42.96.151.160/dota/androidfront/listVideo.action?page=0&catId=-1";
	public final static String URL_LIST_FROM_TYPE = "http://42.96.151.160/dota/androidfront/listVideo.action";
	
	
	public static DotaVideoApplication getInstance(){
		return instance;
	}
	
	@Override
	public void onCreate() {
		// TODO Auto-generated method stub
		super.onCreate();
		instance = this;
		sp = PreferenceManager.getDefaultSharedPreferences(this);
		
		
        DisplayImageOptions defaultOptions = new DisplayImageOptions.Builder()
        .cacheInMemory()
        .cacheOnDisc()
        .build();
        ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(getApplicationContext())
        .defaultDisplayImageOptions(defaultOptions)
        .build();
        ImageLoader.getInstance().init(config); // Do it on Application start
		
		
	}
	
	
	
}
